﻿using FileMonitor.Service.Provider.FileMonitor;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Specialized;

namespace TestProject
{
    
    
    /// <summary>
    ///This is a test class for FileMonitorBaseDataControllerTest and is intended
    ///to contain all FileMonitorBaseDataControllerTest Unit Tests
    ///</summary>
    [TestClass()]
    public class FileMonitorBaseDataControllerTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        internal virtual FileMonitorBase_Accessor CreateFileMonitorBase_Accessor()
        {
            // TODO: Instantiate an appropriate concrete class.
            FileMonitorBase_Accessor target = null;
            return target;
        }

        /// <summary>
        ///A test for NotifyRunBizProcess
        ///</summary>
        [TestMethod()]
        [DeploymentItem("FileMonitor.Service.exe")]
        public void NotifyRunBizProcessTest()
        {
            FileMonitor.Service.TimerTrriger.Trriger.InitializeTrigger();
            FileMonitor.Service.TimerTrriger.Trriger.StartTriggerTimer();
            FileMonitorBase p = FileMonitor.Service.Provider.ProcessProvider.ProcessProvider.GetAllProcess()["IPPDGoodsMovement"];
            p.Start();
            PrivateObject param0 = new PrivateObject(p); // TODO: Initialize to an appropriate value
            FileMonitorBase_Accessor target = new FileMonitorBase_Accessor(param0); // TODO: Initialize to an appropriate value
            NameValueCollection task = new NameValueCollection(); // TODO: Initialize to an appropriate value
            task.Add("Owner", "AHEH");
            task.Add("BatchId", "E052D6DF-97B0-4586-BA72-9FD68F49E862");
            target.NotifyRunBizProcess(task);
            System.Threading.Thread.Sleep(3600*1000);
        }
    }
}
